



import 'package:bike_ride/common/util/hysize_fit.dart';
import 'package:flutter/material.dart';

/// 圆形按钮 例如：首页地图定位、返回、更多等
class CircleButtonWidget extends StatelessWidget {
  final String path;
  final Function() onClick;
  final Color? bgColor;
  const CircleButtonWidget({super.key, required this.path, required this.onClick, this.bgColor});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onClick,
      child: Container(
        padding: EdgeInsets.all(8.rpx),
        decoration: BoxDecoration(
            color: bgColor??Colors.white,
            shape: BoxShape.circle, // 设置容器为圆形
            border: Border.all(
              color: Colors.white70, // 边框颜色
              width: 2.rpx, // 边框宽度
            )),
        child: Image.asset(
          path,
          width: 50.rpx,
          height: 50.rpx,
          fit: BoxFit.fill,
        ),
      ),
    );
  }
}
